package com.jbit.controller;


import com.jbit.common.RespBean;
import com.jbit.service.MenuService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 菜单表 前端控制器
 * </p>
 *
 * @author LiRenZhi
 * @since 2021-08-25
 */
@Api(tags = "菜单模块")
@RestController
@RequestMapping("/menu")
public class MenuController {

    @Autowired
    private MenuService menuService;

    @ApiOperation(value = "根据用户名获取菜单")
    @GetMapping("/")
    public RespBean getAllMenuTree() {
        return RespBean.success().data("menuTree", menuService.getAllMenuTree());
    }
}

